﻿namespace ImageProcessing
{
    using System;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Best bicubic resizing algorithm
    /// </summary>
   public class BestBicubic
    {
        /// <summary>
        /// Pictures the box zoom.
        /// </summary>
        /// <param name="img">The img.</param>
        /// <param name="size">The size.</param>
        /// <returns>image after zoom</returns>
        public static Image PictureResize(Image img, Size size)
        {
            Bitmap bm = new Bitmap(img, Convert.ToInt32(size.Width), Convert.ToInt32(size.Height));
            Graphics grap = Graphics.FromImage(bm);
          
            grap.InterpolationMode = InterpolationMode.HighQualityBicubic;
            return bm;
        }
    }
}
